package com.chis.jxc;

import com.chis.jm.pojo.jxc.TdJxcStmtzx;
import com.chis.jmdatatimer.comm.JedisConnect;
import com.chis.jmdatatimer.comm.TxMgmtModule;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import redis.clients.jedis.ShardedJedis;
import redis.clients.jedis.ShardedJedisPool;

import java.util.List;

public class Redis2Hbase {

    public static void main(String[] args) {
        String std = args[0];
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring.xml"});
        context.start();
        TxMgmtModule txMgmtModule = (TxMgmtModule) context.getBean("TxMgmtModule");
        List<String> list = txMgmtModule.findKc(std);
        System.out.println(list.size());
        ShardedJedisPool jedisPool = JedisConnect.getInstance().jedisPoolJxc;
        ShardedJedis jedis = jedisPool.getResource();
        jedis.select(4);
        for(String t :list){
            System.out.println("cntguid = "+t);
            List<String> codes = txMgmtModule.kccodeyz(t);
            if(codes != null && codes.size() > 0){
                for(String s : codes){
                    if(jedis.get(s.getBytes()) == null){
                        System.out.println(s);
                    }
                }
            }
        }
        jedis.close();
    }
}
